import Cookies from 'js-cookie'

const TokenKey = 'ya-dian-xin-neng'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token, expires) {
  // const _expires = new Date(new Date().getTime() + expires * 1000)
  // console.log(_expires, typeof _expires)
  return Cookies.set(TokenKey, token, { expires: expires })
}
export function removeToken() {
  return Cookies.remove(TokenKey)
}
